POV-Ray : Newsgroups : povray.advanced-users : movie within : Re: movie within Server Time
28 Jul 2024 20:31:46 EDT (-0400)
  Re: movie within  
From: Marvin Taylor
Date: 27 Jan 2004 18:09:19
Message: <4016ef9f$1@news.povray.org>
Dan P wrote:

> When you specify your image_map file name, use concat(str1, str2) to build
> it from the frame_number value. In your case, you could do something like
> this:
> 
>     ....
>     image_map
>     {
>         png concat("file_", str(frame_number, -3), ".png")
>     }
>     ....
> 

This requires your frame rate to exactly match that of the movie you are 
including.  A more consistent approach would be to interpolate based on 
'clock' rather than 'frame_number'.

(I frequently alter my frame rate when debugging).  The following seems 
to work as I expected it to do.  It returns the filename to be used in 
the image_map.

Cheers,
Marvin

////////////////////////////////////////////////////////////////////
//
// Return filename for an embedded movie.  Parameters are:
//   iclk = clock value for the first frame,
//   zclk = clock value for the first frame,
//   ifrm = the number of the first frame,
//   zfrm = the number of the last frame,
//   digs = the number of digits to pad (NEGATIVE),
//   base = Portion of filename to put before digits,
//   suff = Portion of filename to put after digits.
//
// NOTE: This should not be used when 'clock' is outside of the
// range of 'iclk' to 'zclk'.
//
// For example, from clock 0.0 to 1.0 the following will interpolate
// and return a string in the sequence "file000.png" to "file040.png"
//
//    EmbeddedMovie(0.0, 1.0, 0, 40, -3, "file", ".png" )
//
//
#macro EmbeddedMovie(iclk, zclk, ifrm, zfrm, digs, base, suff )
	#local nfrm = ifrm+(zfrm-ifrm)*(clock-iclk)/(zclk-iclk);
	concat(base, str(nfrm, digs, 0), suff)
#end


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.